package Controls;

public class DateHelper {
	
	public static String SqlDateToString(String strSqlDate){
		strSqlDate = strSqlDate.trim();
		if(strSqlDate.length() >0){
			String month = strSqlDate.substring(4, 6);
				//GetStringMonth(strSqlDate.substring(4, 6));
			String day = strSqlDate.substring(6, 8);
			String yeah = strSqlDate.substring(0, 4);
			return  yeah + "/" + month + "/" + day ;
		}
		return "";
	}
	
	public static String GetStringMonth(String monthNum){
		if(monthNum.substring(0, 1) ==  "0"){
			monthNum = monthNum.substring(1, 1);
		}
		try
		{
			int month = Integer.parseInt(monthNum);
			switch (month) {
			case 1:
				return "Jan";
			case 2:
				return "Feb";
			case 3:
				return "Mar";
			case 4:
				return "Apr";
			case 5:
				return "May";
			case 6:
				return "Jun";
			case 7:
				return "July";
			case 8:
				return "Aug";
			case 9:
				return "Sep";
			case 10:
				return "Oct";
			case 11:
				return "Nov";
			case 12:
				return "Dec";
			}
			
		}catch (Exception e) {
			return monthNum;
		}
		
		return monthNum;
	}

}
